function Rectangle(name, width, height) {
  this.name = name;
  this.width = width;
  this.height = height;
  this.area = function () {
  	return this.width * this.height;
  };
}


const rect = new Rectangle("矩形 1", 10, 10);
console.log(rect.area()); // 输出：100Lab16 OOP2 11
console.log(rect.perimeter()); // 输出：40
console.log(rect.isSquare()); // 输出：true
rect.changeName("测试矩形");
console.log(rect.name); // 输出：测试矩形

const rect2 = new Rectangle("矩形 2", 30, 40);
console.log(rect2.area()); // 输出：1200
console.log(rect2.perimeter()); // 输出：140
console.log(rect2.isSquare()); // 输出：false


